1. Field of the Invention
The present invention relates generally to computer-implemented compilers for high-level programming languages and their associated run-time environments, and in particular, to a computer-implemented method for supporting multiple file-systems in file input/output (I/O) operations.
2. Description of the Related Art
A compiler is a computer program that translates a source program into an equivalent object program that can be executed by a computer. The source program is typically comprised of high-level source language statements like COBOL, and the object language is the assembly language or machine code of some computer. The translation of the kit source program into the object program occurs at compile-time; the actual execution of the object program occurs at run-time.
A compiler must perform an analysis of the source program and then it must perform a synthesis of the object program, wherein it first decomposes the source program into its basic parts, and then builds the equivalent object program parts from the parts of the source program. As a source program is analyzed, information is obtained from declarations and procedural statements, such as loops and file I/O verbs.
Compilers for the COBOL programming language are well known in the art. In addition, run-time environments for COBOL-based computer programs are also well known in the art. The COBOL language has evolved into a standard language for business applications on mainframes and minicomputers, and has been adopted as such by the American National Standards Institute, Inc. (ANSI).
As a general rule, a file name is specified by COBOL source language statements using the xe2x80x9cSELECTxe2x80x9d and xe2x80x9cASSIGNxe2x80x9d clauses. Such statements are specified using one of the following formats:
SELECT [OPTIONAL] FileId ASSIGN {TO literal}
SELECT [OPTIONAL] FileId ASSIGN {TO implementor-name}
SELECT [OPTIONAL] FileId ASSIGN {USING data-name}
wherein xe2x80x9cFileIdxe2x80x9d represents the file identifier used within the source program to reference or identify input/output operations, and xe2x80x9cimplementor-namexe2x80x9d, xe2x80x9cliteralxe2x80x9d, and xe2x80x9cdata-namexe2x80x9d represents the file identification as known by the computer system. The xe2x80x9cimplementor-namexe2x80x9d may be a string representing the file identification or the name of an environment variable whose value is a string representing the file identification that may be set prior to object program execution. The xe2x80x9cliteralxe2x80x9d is a string representing the file identification. The xe2x80x9cdata-namexe2x80x9d is a variable containing a string representing the file identification at execution time.
In many computer platforms, multiple file-systems are available for use with application programs. Thus, it is important for a computer language product (such as COBOL) to support and provide an interface to these multiple file-systems. In such an environment, an application program should be able to access files of various different file-systems.
However, it is necessary to make the selection of a file-system as transparent as possible to the application program. Additionally, the support of access to multiple file-systems from programs written in a high-level programming language should be relatively easy to implement.
In order to address the above requirements, the present invention provides a method for supporting multiple file-systems for high-level language (such as COBOL) file input/output (I/O) operations.
To address the requirements described above, the present invention discloses a method, apparatus, and article of manufacture for supporting file input/output (I/O) operations to multiple file-systems through applications written in a high-level computer language, such as COBOL.
In the present invention, the source program may include a literal identifying the specific file-system. Alternatively, the source program may use a data name or variable to store a string representation of the file-system identifier that is constructed or specified by the source program, or retrieved from an external source. In addition, an environment variable that stores a string representation of the file-system identifier may be specified at object program run-time. These capabilities are provided by extensions to standard programming language conventions that are recognized and processed within a compiler.
An object of the present invention is to allow different file-systems to be specified in source language statements. Another object of the present invention is to permit an object program to access different file-systems without recompilation, using data names or environment variables. Yet another object of the present invention is to make the interfaces within the source language independent of the specified file-system, so that support of any number of different file-systems can be accomplished with relative ease. Still another object of the present invention is to provide the ability to dynamically select a file-system on a file-by-file basis, thereby allowing the program to use a first file-system for one file and a second file-system for another file.